package com.fz.mapper;

import com.fz.entity.Student;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.StatementType;

import java.util.List;

/**
 * Created by webrx on 2017-08-25.
 */
public interface StudentMapper {
    @Select("select * from db_student order by id desc")
    public List<Student> query();

    @Delete("delete from db_student where id=#{id}")
    public int deleteById(int id);


    @Select("call dbs") @Options(statementType = StatementType.CALLABLE)
    public List<Student> dbs();

    @Delete("call del(#{id})") @Options(statementType = StatementType.CALLABLE)
    public void del(int id);

    @Update("call upd(#{uid},#{name})")
    public void update(@Param("uid") int id,@Param("name") String name);

    @Select("select * from db_student limit #{start},#{size}")
    public List<Student> page(@Param("start") int start,@Param("size") int size);

    @Select("select count(*) from db_student")
    public int getCount();
}
